home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 1
/
SPACE - Library 1 - Volume 1.iso
/
telecomm
/
309
/
dualterm
/
to_ascii.gfa
(
.txt
)
< prev
next >
Wrap
GFA-BASIC Atari
|
1988-11-27
|
2KB
|
55 lines
'
' TO_ASCII.BAS - converts atascii text files to ascii
'
CLS
PRINT "Normal ATASCII text files cannot be viewed from the ST desktop or loaded"
PRINT "into most ST text editors. This program converts these files to standard"
PRINT "ST format. In the interest of speed, the program does not attemt to convert"
PRINT "special ATASCII characters into their VT52 equivalents. It only strips off"
PRINT "the high bit on each character and converts the ATASCII CR to ASCII CR/LF."
PRINT
PRINT "Because of the buffers used to speed things up, the program must have free"
PRINT "memory available of twice the file size being converted."
PRINT
PRINT "press any key..."
'
KEYGET dummy|
CLS
PRINT "Select ATASCII file to convert:"
FILESELECT DIR$(0)+"\*.*","",filename$
IF EXIST(filename$)
OPEN "I",#1,filename$
length%=LOF(#1)
DIM buffer|(length%)
buf1%=VARPTR(buffer|(0))
DIM buffer2|(length%*1.1)
buf2%=VARPTR(buffer2|(0))
BGET #1,buf1%,length%
CLOSE #1
CLS
PRINT "Select new ascii filename:"
FILESELECT DIR$(0)+"\*.*","",filename$
IF filename$<>""
OPEN "O",#2,filename$
CLS
DEFMOUSE 2
index%=0
FOR ctr%=0 TO length%-1
IF buffer|(ctr%)=155
buffer2|(index%)=13
INC index%
buffer2|(index%)=10
ELSE
buffer2|(index%)=buffer|(ctr%) AND 127
ENDIF
INC index%
NEXT ctr%
BPUT #2,buf2%,index%
CLOSE #2
DEFMOUSE 0
ENDIF
ENDIF
SYSTEM
'
' end of listing